-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt to math-comp/math-comp#1125 #1271
Conversation
After spending two full days (mostly on recompiling stuff), I managed to adapt Analysis to math-comp/math-comp#1125. Most issues have been fixed on the MathComp side. However, it seems that I happened to break the mechanism to automatically prove positivity conditions like |
Isn't it the mechanism implemented in |
Yes, that's in |
I'm taking a look at Variant nullity := NonZero | MaybeZero.
Variant sign := EqZero | NonNeg | NonPos.
Variant real := Sign of sign | AnySign.
Variant reality := Real of real | Arbitrary. I have the impression that it should be expressed as a tuple of 4 boolean values Also, the instance for |
@@ -497,7 +497,7 @@ apply/ler_gtP => _ /posnumP[e]; rewrite ler_pdivrMr //. | |||
have /oid /nbhs_ballP [_ /posnumP[d] dfe] := !! gt0 e. | |||
set k := ((d%:num / 2) / (PosNum xn0)%:num)^-1. | |||
rewrite -{1}(@scalerKV _ _ k _ x) /k // linearZZ normrZ. | |||
rewrite -ler_pdivlMl; last by rewrite gtr0_norm. | |||
rewrite -ler_pdivlMl; last by rewrite gtr0_norm invr_gt0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the actual source of the issue I have is that the goal after rewrite gtr0_norm
is now:
0 < idfun (d%:num / 2 / (PosNum xn0)%:num)^-1
where idfun
is actually a homomorphism application:
GRing.RMorphism.sort (reverse_coercion (GRing.ssrfun_idfun__canonical__GRing_RMorphism ...) idfun)
simpl
unfolds (PosNum xn0)%:num
and thus is too aggressive here. Declaring a signed
instance for homomorphisms would require the structures of order-preserving additive functions and ring homomorphisms, which we don't have in Mathcomp yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also expected the canonical structure inference to unfold this homomorphism application automatically, but is it because of the presence of a default instance that it does not happen?
Sorry, could you explain what would be the advantages of such an encoding? I can clearly see the drawback of having all parameters of the same type (much higher risk to inadvertently mixing them) but not the advantages.
Sure, feel free to strengthen it. The only thing proved is the soundness, not that we provide the best approximation. |
The current encoding doesn't seem to allow us to encode some cases, e.g., |
Variant positivity := NonPos | MaybePos.
Variant nullity := NonZero | MaybeZero.
Variant negativity := NonNeg | MaybeNeg.
Variant reality := IsReal | MaybeNonReal. |
Right, that's the point of an abstraction to not be able to encode precisely everything. And indeed it could be refined if needed (but there will always be things that cannot be encoded).
That's the set of values that are both non zero and equal to zero, that is the empty set (enabling to prove False).
Sure, precise types are better than boolean, but I still fail to see the details. What would be the semantics of a tuple? I would expect conjunction of individual semantics of each element, but then some encoding become uselessly redundant: for instance NonPos * MaybeReal and NonPos * IsReal represent the same thing since being NonPos implies being Real. |
|
Ha, my bad, I thought it was the usual mathematical definition |
Since we decided to remove the new parameters of the |
Motivation for this change
See math-comp/math-comp#1125.
Checklist
CHANGELOG_UNRELEASED.md
Reference: How to document
Reminder to reviewers